<template>
  <li>
    <span>{{i}}</span>
    <input type="checkbox" v-model="v.check">
    <span>{{v.title}}</span>
    <button @click.prevent="remove">删除</button>
  </li>
</template>

<script>
  import PubSub from "pubsub-js"

  export default {
    name: "Item",
    props: ["v", "i"],
    methods: {
      remove() {
        // 组件间通信 发布消息
        PubSub.publish("del", this.i)
      }
    }
  }
</script>

<style scoped>

</style>
